package com.example.demo.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.GroupedOpenApi;  // ✅ 正确路径
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {

    @Bean
    public OpenAPI baseOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("MBTI 测试系统接口文档")
                        .version("1.0")
                        .description("用于展示 MBTI 测试系统的所有接口及其说明"));
    }

    @Bean
    public GroupedOpenApi publicApi() {
        return GroupedOpenApi.builder()
                .group("mbti-api")
                .packagesToScan("com.example.demo.controller")
                .build();
    }
}
